import axios from "../utils/axios";
// 获取用户信息接口
export const getUserInfo = () => {
  return axios.get("/users/getUserInfo");
};
// 登录接口
export const loginApi = (username, password) => {
  return axios.post("/users/login", { username, password,loginSystem:1 });
};

// 退出登录
export const logoutApi = () => {
  return axios.post("/users/logout", {
    loginSystem:1
  });
};
// 获取用户列表
export const getUserList = (filters) => {
  return axios.get("/users/getUserList", { params: filters });
};

export const addUser = (userData) => {
  return axios.post("/users/addUser", userData);
};

export const deleteUser = (userId) => {
  return axios.delete(`/users/deleteUser/${userId}`);
};

export const updateUserStatus = (userId, status, disableReason) => {
  return axios.put(`/users/updateUserStatus/${userId}`, {
    status,
    disableReason,
  });
};
